<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Kind Commands</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Kind Commands' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../services.html">Services</a></li><li><a href="index.html">kinds</a></li><li><a href="index.html#4">Chapter 4: Constructors</a></li><li><b>Kind Commands</b></li></ul></div>
<p class="purpose">To apply a given command to a given kind constructor.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">KindCommands::apply</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">KindCommands::apply</span></span>:<br/>Neptune Files - <a href="4-nf.html#SP1">&#167;1</a><br/>Macros - <a href="4-mcr.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">single_kind_command</span><span class="plain-syntax"> </span><span class="identifier-syntax">stc</span><span class="plain-syntax">, </span><span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">con</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">completed</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">KIND_CREATIONS</span><span class="plain-syntax">, </span><span class="string-syntax">"apply: %s (%d/%d/%S/%S) to %d/%S\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">which_kind_command</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">text_of_command</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">boolean_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">numeric_argument</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">constructor_argument</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">, </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">explicit_identifier</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">which_kind_command</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">opcode_number</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_1" class="named-paragraph-link"><span class="named-paragraph">Apply kind macros or transcribe kind templates on request</span><span class="named-paragraph-number">1.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_2" class="named-paragraph-link"><span class="named-paragraph">Most kind commands simply set a field in the constructor structure</span><span class="named-paragraph-number">1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_3" class="named-paragraph-link"><span class="named-paragraph">A few kind commands contribute to linked lists in the constructor structure</span><span class="named-paragraph-number">1.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4" class="named-paragraph-link"><span class="named-paragraph">And the rest fill in fields in the constructor structure in miscellaneous other ways</span><span class="named-paragraph-number">1.4</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">cmd</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">cmd</span><span class="plain-syntax">, </span><span class="string-syntax">"%s"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">which_kind_command</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">text_of_command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cmd</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"unimplemented kind command"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">cmd</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP1_1" class="paragraph-anchor"></a><b>&#167;1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Apply kind macros or transcribe kind templates on request</span><span class="named-paragraph-number">1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">invent_source_text_KCC:</span>
<span class="plain-syntax">            </span><a href="4-st.html#SP3" class="function-link"><span class="function-syntax">StarTemplates::note</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">template_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">con</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">apply_macro_KCC:</span>
<span class="plain-syntax">            </span><a href="4-mcr.html#SP2" class="function-link"><span class="function-syntax">NeptuneMacros::play_back</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">macro_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">con</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-kc.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2" class="paragraph-anchor"></a><b>&#167;1.2. </b></p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">field</span><span class="plain-syntax">) </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">field</span><span class="plain-syntax">##</span><span class="identifier-syntax">_KCC:</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">field</span><span class="plain-syntax"> = </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">boolean_argument</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">SET_INTEGER_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">field</span><span class="plain-syntax">) </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">field</span><span class="plain-syntax">##</span><span class="identifier-syntax">_KCC:</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">field</span><span class="plain-syntax"> = </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">numeric_argument</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">field</span><span class="plain-syntax">) </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">field</span><span class="plain-syntax">##</span><span class="identifier-syntax">_KCC:</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">field</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">SET_CCM_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">field</span><span class="plain-syntax">) </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">field</span><span class="plain-syntax">##</span><span class="identifier-syntax">_KCC:</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">field</span><span class="plain-syntax"> = </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">ccm_argument</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Most kind commands simply set a field in the constructor structure</span><span class="named-paragraph-number">1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">can_coincide_with_property</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">can_exchange</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">indexed_grey_if_empty</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">is_incompletely_defined</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">forbid_assertion_creation</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_BOOLEAN_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">dimensionless</span><span class="plain-syntax">)</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">SET_INTEGER_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">index_priority</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_INTEGER_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">short_block_size</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_INTEGER_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">long_block_size</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_INTEGER_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">flexible_long_block_size</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_INTEGER_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">arithmetic_modulus</span><span class="plain-syntax">)</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">SET_CCM_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">constant_compilation_method</span><span class="plain-syntax">)</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">default_value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">distinguish_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">documentation_reference</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">understand_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">index_default_value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">index_maximum_value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">index_minimum_value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">loop_domain_schema</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">recognise_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">specification_text</span><span class="plain-syntax">)</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">cast_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">copy_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">copy_short_block_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">quick_copy_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">destroy_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">make_mutable_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">hash_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">long_block_size_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">serialise_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SET_TEXTUAL_FIELD</span><span class="plain-syntax">(</span><span class="identifier-syntax">unserialise_function</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-kc.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3" class="paragraph-anchor"></a><b>&#167;1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A few kind commands contribute to linked lists in the constructor structure</span><span class="named-paragraph-number">1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax"> == </span><span class="constant-syntax">compatible_with_KCC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">CORE_MODULE</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">constructor_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"SNIPPET_TY"</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">FEATURE_INACTIVE</span><span class="plain-syntax">(</span><span class="identifier-syntax">parsing</span><span class="plain-syntax">))) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">kind_constructor_casting_rule</span><span class="plain-syntax"> *</span><span class="identifier-syntax">dtcr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">kind_constructor_casting_rule</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_casting_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_casting_rule</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_casting_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">dtcr</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cast_from_kind_unparsed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">constructor_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cast_from_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax"> == </span><span class="constant-syntax">conforms_to_KCC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">kind_constructor_instance_rule</span><span class="plain-syntax"> *</span><span class="identifier-syntax">dti</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">kind_constructor_instance_rule</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dti</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_instance_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_instance_rule</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_instance_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">dti</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dti</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_of_this_unparsed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">constructor_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dti</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_of_this</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax"> == </span><span class="constant-syntax">comparison_schema_KCC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">kind_constructor_comparison_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">dtcs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">kind_constructor_comparison_schema</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_comparison_schema</span><span class="plain-syntax"> = </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_comparison_schema</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_comparison_schema</span><span class="plain-syntax"> = </span><span class="identifier-syntax">dtcs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">comparator_unparsed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">constructor_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">comparator</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">dtcs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">comparison_schema</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax"> == </span><span class="constant-syntax">instance_KCC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *(%c+?) *= *(%C+) *= *(%C+) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">kind_constructor_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kci</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">kind_constructor_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">natural_language_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">value</span><span class="plain-syntax"> = </span><a href="4-kc.html#SP2" class="function-link"><span class="function-syntax">KindCommands::parse_literal_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[2], &amp;</span><span class="identifier-syntax">bad</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">value_specified</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bad</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I</span><span class="string-syntax">"value after the final '=' is not a valid Inform 6 literal"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">value</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">value_specified</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">kci</span><span class="plain-syntax">, </span><span class="reserved-syntax">kind_constructor_instance</span><span class="plain-syntax">, </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instances</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *(%c+?) *= *(%C+) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">kind_constructor_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kci</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">kind_constructor_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">natural_language_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">value</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kci</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">value_specified</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">kci</span><span class="plain-syntax">, </span><span class="reserved-syntax">kind_constructor_instance</span><span class="plain-syntax">, </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instances</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">I</span><span class="string-syntax">"instance not in form NAME = IDENTIFIER = VALUE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-kc.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_4" class="paragraph-anchor"></a><b>&#167;1.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">And the rest fill in fields in the constructor structure in miscellaneous other ways</span><span class="named-paragraph-number">1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">terms_KCC:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_1" class="named-paragraph-link"><span class="named-paragraph">Parse the constructor arity text</span><span class="named-paragraph-number">1.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">compare_function_KCC:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">31</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"overlong identifier"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">comparison_routine</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">say_function_KCC:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">31</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"overlong identifier"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">print_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">printing_routine_for_debugging_KCC:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">31</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"overlong identifier"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ACTIONS_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">singular_KCC:</span><span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">plural_KCC:</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> **</span><span class="identifier-syntax">array</span><span class="plain-syntax">; </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">length</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WordAssemblages::as_array</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">vocabulary_argument</span><span class="plain-syntax">), &amp;</span><span class="identifier-syntax">array</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">length</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">length</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><a href="2-knd.html#SP25" class="function-link"><span class="function-syntax">Kinds::mark_vocabulary_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">array</span><span class="plain-syntax">[0], </span><a href="2-knd.html#SP6" class="function-link"><span class="function-syntax">Kinds::base_construction</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">con</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">length</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">Vocabulary::set_flags</span><span class="plain-syntax">(</span><span class="identifier-syntax">array</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">], </span><span class="constant-syntax">KIND_SLOW_MC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">NTI::mark_vocabulary</span><span class="plain-syntax">(</span><span class="identifier-syntax">array</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">], </span><span class="function-syntax">&lt;k-kind&gt;</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">group</span><span class="plain-syntax"> != </span><span class="constant-syntax">PROPER_CONSTRUCTOR_GRP</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::hyphenated</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">vocabulary_argument</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ve</span><span class="plain-syntax">) </span><a href="2-knd.html#SP25" class="function-link"><span class="function-syntax">Kinds::mark_vocabulary_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><a href="2-knd.html#SP6" class="function-link"><span class="function-syntax">Kinds::base_construction</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">con</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">feed_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::begin</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">length</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Feeds::feed_C_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">array</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">], </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">LW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::end</span><span class="plain-syntax">(</span><span class="identifier-syntax">id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcc</span><span class="plain-syntax"> == </span><span class="constant-syntax">singular_KCC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">ro</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">group</span><span class="plain-syntax"> != </span><span class="constant-syntax">PROPER_CONSTRUCTOR_GRP</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">ro</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ADD_TO_LEXICON_NTOPT</span><span class="plain-syntax"> + </span><span class="identifier-syntax">WITH_PLURAL_FORMS_NTOPT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">CORE_MODULE</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Task::language_of_syntax</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">noun</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nt</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">Nouns::new_common_noun</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">, </span><span class="identifier-syntax">NEUTER_GENDER</span><span class="plain-syntax">, </span><span class="identifier-syntax">ro</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="constant-syntax">KIND_SLOW_MC</span><span class="plain-syntax">, </span><span class="identifier-syntax">STORE_POINTER_kind_constructor</span><span class="plain-syntax">(</span><span class="identifier-syntax">con</span><span class="plain-syntax">), </span><span class="identifier-syntax">L</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">dt_tag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">nt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">CORE_MODULE</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Task::language_of_syntax</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Nouns::set_nominative_plural_in_language</span><span class="plain-syntax">(</span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">dt_tag</span><span class="plain-syntax">, </span><span class="identifier-syntax">LW</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">plus_schema_KCC:</span><span class="plain-syntax">        { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">PLUS_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">minus_schema_KCC:</span><span class="plain-syntax">       { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">MINUS_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">times_schema_KCC:</span><span class="plain-syntax">       { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">TIMES_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">divide_schema_KCC:</span><span class="plain-syntax">      { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">DIVIDE_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">remainder_schema_KCC:</span><span class="plain-syntax">   { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">REMAINDER_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">approximate_schema_KCC:</span><span class="plain-syntax"> { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">APPROXIMATE_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">negate_schema_KCC:</span><span class="plain-syntax">      { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">NEGATE_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">root_schema_KCC:</span><span class="plain-syntax">        { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">ROOT_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">cuberoot_schema_KCC:</span><span class="plain-syntax">    { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">CUBEROOT_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">power_schema_KCC:</span><span class="plain-syntax">       { </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">POWER_OPERATION</span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-kc.html#SP1_4_2" class="named-paragraph-link"><span class="named-paragraph">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-kc.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_4_1" class="paragraph-anchor"></a><b>&#167;1.4.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the constructor arity text</span><span class="named-paragraph-number">1.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">string_position</span><span class="plain-syntax"> </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::start</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::is_space_or_tab</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">))) </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::forward</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) == </span><span class="character-syntax">','</span><span class="plain-syntax">) { </span><span class="identifier-syntax">c</span><span class="plain-syntax">++; </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::forward</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">); </span><span class="reserved-syntax">continue</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) { </span><span class="identifier-syntax">c</span><span class="plain-syntax">=1; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">while</span><span class="plain-syntax"> ((!</span><span class="identifier-syntax">Characters::is_space_or_tab</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">))) &amp;&amp; (</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) != </span><span class="character-syntax">','</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            &amp;&amp; (</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) != </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">)); </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::forward</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_wide_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"covariant"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">variance</span><span class="plain-syntax">[</span><span class="identifier-syntax">c</span><span class="plain-syntax">] = </span><span class="constant-syntax">COVARIANT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_wide_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"contravariant"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">variance</span><span class="plain-syntax">[</span><span class="identifier-syntax">c</span><span class="plain-syntax">] = </span><span class="constant-syntax">CONTRAVARIANT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_wide_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"optional"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tupling</span><span class="plain-syntax">[</span><span class="identifier-syntax">c</span><span class="plain-syntax">] = </span><span class="constant-syntax">ALLOW_NOTHING_TUPLING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_wide_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"list"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tupling</span><span class="plain-syntax">[</span><span class="identifier-syntax">c</span><span class="plain-syntax">] = </span><span class="constant-syntax">ARBITRARY_TUPLING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="4-nf.html#SP2" class="function-link"><span class="function-syntax">NeptuneFiles::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"illegal constructor-arity keyword"</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">wd</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">constructor_arity</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">+1;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-kc.html#SP1_4">&#167;1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_4_2" class="paragraph-anchor"></a><b>&#167;1.4.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Arithmetic schema</span><span class="named-paragraph-number">1.4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">arithmetic_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ars</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">arithmetic_schema</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">operands</span><span class="plain-syntax">[0] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">operands</span><span class="plain-syntax">[1] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">operands_unparsed</span><span class="plain-syntax">[0] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">operands_unparsed</span><span class="plain-syntax">[1] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"(%C+), *(%C+): *(%c+)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">operands_unparsed</span><span class="plain-syntax">[0] = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">operands_unparsed</span><span class="plain-syntax">[1] = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">schema</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[2]);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ars</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">schema</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">stc</span><span class="plain-syntax">.</span><span class="element-syntax">textual_argument</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ars</span><span class="plain-syntax">, </span><span class="reserved-syntax">arithmetic_schema</span><span class="plain-syntax">, </span><span class="identifier-syntax">con</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">arithmetic_schemas</span><span class="plain-syntax">[</span><span class="identifier-syntax">op</span><span class="plain-syntax">]);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-kc.html#SP1_4">&#167;1.4</a> (10 times).</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>This is used for parsing the values of enumeration members in <span class="extract"><span class="extract-syntax">instance</span></span>
commands:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">KindCommands::parse_literal_number</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">KindCommands::parse_literal_number</span></span>:<br/><a href="4-kc.html#SP1_3">&#167;1.3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bad</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sign</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">)-1;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">unsigned</span><span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">base</span><span class="plain-syntax"> = </span><span class="constant-syntax">10</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'('</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">) == </span><span class="character-syntax">')'</span><span class="plain-syntax">)) { </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; </span><span class="identifier-syntax">to</span><span class="plain-syntax">--; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">))) </span><span class="identifier-syntax">from</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">))) </span><span class="identifier-syntax">to</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) { </span><span class="identifier-syntax">sign</span><span class="plain-syntax"> = -1; </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'$'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; </span><span class="identifier-syntax">base</span><span class="plain-syntax"> = </span><span class="constant-syntax">16</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'$'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; </span><span class="identifier-syntax">base</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">from</span><span class="plain-syntax">) </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">to</span><span class="plain-syntax">) </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">), </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="character-syntax">'a'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &lt;= </span><span class="character-syntax">'z'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">-</span><span class="character-syntax">'a'</span><span class="plain-syntax">+10;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="character-syntax">'A'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &lt;= </span><span class="character-syntax">'Z'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">-</span><span class="character-syntax">'A'</span><span class="plain-syntax">+10;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="character-syntax">'0'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &lt;= </span><span class="character-syntax">'9'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">-</span><span class="character-syntax">'0'</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> { *</span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">d</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">base</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="identifier-syntax">base</span><span class="plain-syntax">*</span><span class="identifier-syntax">N</span><span class="plain-syntax"> + (</span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">d</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">34</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">bad</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="identifier-syntax">sign</span><span class="plain-syntax">*</span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> -1;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-st.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-km.html">1</a></li><li class="progresschapter"><a href="2-knd.html">2</a></li><li class="progresschapter"><a href="3-dmn.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresssection"><a href="4-abgtn.html">abgtn</a></li><li class="progresssection"><a href="4-nf.html">nf</a></li><li class="progresssection"><a href="4-ns.html">ns</a></li><li class="progresssection"><a href="4-mcr.html">mcr</a></li><li class="progresssection"><a href="4-st.html">st</a></li><li class="progresscurrent">kc</li><li class="progresssection"><a href="4-kc2.html">kc2</a></li><li class="progressnext"><a href="4-kc2.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

